<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
    

    

    



    <meta charset="utf-8">
    
    
    <meta name="sogou_site_verification" content="true">
    
    
    
    <title>Hexo博客部署到Linux服务器上 | Lvshen&#39;s Blog | This is My World</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="Hexo,博客">
    <meta name="baidu-site-verification" content="VIVNdSiMZm">
    <meta name="description" content="服务器部署博客：AsiaInfo 以前Hexo博客是托管到github上，因为国内访问github速度有些慢，这次试着把博客部署到阿里云的服务器上。本地系统Windows10上需要安装node.js+hexo。下面做一个详细的介绍。 本地端安装git bash（git安装原文来自百度经验）由于使用的是git命令。所以需要安装git bash，安装过程如下。 由于安装过程千篇一律，安装的详细过程请百">
<meta name="keywords" content="Hexo,博客">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo博客部署到Linux服务器上">
<meta property="og:url" content="https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/index.html">
<meta property="og:site_name" content="Lvshen&#39;s Blog">
<meta property="og:description" content="服务器部署博客：AsiaInfo 以前Hexo博客是托管到github上，因为国内访问github速度有些慢，这次试着把博客部署到阿里云的服务器上。本地系统Windows10上需要安装node.js+hexo。下面做一个详细的介绍。 本地端安装git bash（git安装原文来自百度经验）由于使用的是git命令。所以需要安装git bash，安装过程如下。 由于安装过程千篇一律，安装的详细过程请百">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step1.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step2.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step3.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step4.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step5.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step6.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step7.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step8.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/node-version-test.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-exe-on-windows-step1.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-exe-on-windows-step21.png">
<meta property="og:image" content="http://www.runoob.com/wp-content/uploads/2014/03/node-version.png">
<meta property="og:image" content="http://7xs3op.com1.z0.glb.clouddn.com/hexo%E5%AE%8C%E6%88%90%E5%88%9D%E5%A7%8B%E5%8C%96.png">
<meta property="og:image" content="http://7xs3op.com1.z0.glb.clouddn.com/hexo%E7%9B%AE%E5%BD%95.png">
<meta property="og:image" content="http://7xs3op.com1.z0.glb.clouddn.com/4000.png">
<meta property="og:image" content="http://7xs3op.com1.z0.glb.clouddn.com/5000.png">
<meta property="og:image" content="http://7xs3op.com1.z0.glb.clouddn.com/%E8%AE%BF%E9%97%AE%E6%88%90%E5%8A%9F.png">
<meta property="og:updated_time" content="2018-01-08T08:37:57.457Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hexo博客部署到Linux服务器上">
<meta name="twitter:description" content="服务器部署博客：AsiaInfo 以前Hexo博客是托管到github上，因为国内访问github速度有些慢，这次试着把博客部署到阿里云的服务器上。本地系统Windows10上需要安装node.js+hexo。下面做一个详细的介绍。 本地端安装git bash（git安装原文来自百度经验）由于使用的是git命令。所以需要安装git bash，安装过程如下。 由于安装过程千篇一律，安装的详细过程请百">
<meta name="twitter:image" content="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step1.png">
    
    <link rel="shortcut icon" href="/img/mylogo.jpg">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">我的技术小房间</h5>
          <a href="mailto:https://lvshen9.github.io" title="https://lvshen9.github.io" class="mail">https://lvshen9.github.io</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/about"  >
                <i class="icon icon-lg icon-address-book"></i>
                About
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/collection"  >
                <i class="icon icon-lg icon-apple"></i>
                Collection
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://lvshen9.github.io/" target="_blank" >
                <i class="icon icon-lg icon-wordpress"></i>
                Blog
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/lvshen9" target="_blank" >
                <i class="icon icon-lg icon-github-alt"></i>
                GitHub
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">Hexo博客部署到Linux服务器上</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">Hexo博客部署到Linux服务器上</h1>
        <h5 class="subtitle">
            
                <time datetime="2018-01-08T05:53:55.000Z" itemprop="datePublished" class="page-time">
  2018-01-08
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/Work/">Work</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#本地端"><span class="post-toc-number">1.</span> <span class="post-toc-text">本地端</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#安装git-bash（git安装原文来自百度经验）"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">安装git bash（git安装原文来自百度经验）</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#安装node-js"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">安装node.js</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#1、Windows-安装包-msi"><span class="post-toc-number">1.2.1.</span> <span class="post-toc-text">1、Windows 安装包(.msi)</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#2、Windows-二进制文件-exe-安装"><span class="post-toc-number">1.2.2.</span> <span class="post-toc-text">2、Windows 二进制文件 (.exe)安装</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#版本测试"><span class="post-toc-number">1.2.3.</span> <span class="post-toc-text">版本测试</span></a></li></ol></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#Hexo安装"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">Hexo安装</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#利用命令行安装hexo"><span class="post-toc-number">1.3.1.</span> <span class="post-toc-text">利用命令行安装hexo</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#创建本地hexo文件夹-地址名字可自定义"><span class="post-toc-number">1.3.2.</span> <span class="post-toc-text">创建本地hexo文件夹(地址名字可自定义)</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#本地校验查看"><span class="post-toc-number">1.3.3.</span> <span class="post-toc-text">本地校验查看</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#Hexo主题设置"><span class="post-toc-number">1.3.4.</span> <span class="post-toc-text">Hexo主题设置</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#服务器端"><span class="post-toc-number">2.</span> <span class="post-toc-text">服务器端</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#创建私有-Git-仓库"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">创建私有 Git 仓库</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#创建-Git-钩子"><span class="post-toc-number">2.2.</span> <span class="post-toc-text">创建 Git 钩子</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#配置-Nginx-托管文件目录"><span class="post-toc-number">2.3.</span> <span class="post-toc-text">配置 Nginx 托管文件目录</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#建立SSH信任关系"><span class="post-toc-number">2.4.</span> <span class="post-toc-text">建立SSH信任关系</span></a></li></ol></li></ol>
        </nav>
    </aside>


<article id="post-Hexo博客部署到Linux服务器上"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">Hexo博客部署到Linux服务器上</h1>
        <div class="post-meta">
            <time class="post-time" title="2018-01-08 13:53:55" datetime="2018-01-08T05:53:55.000Z"  itemprop="datePublished">2018-01-08</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/Work/">Work</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>服务器部署博客：<a href="http://bl.wadecn.com/" target="_blank" rel="noopener">AsiaInfo</a></p>
<p>以前Hexo博客是托管到github上，因为国内访问github速度有些慢，这次试着把博客部署到阿里云的服务器上。本地系统Windows10上需要安装node.js+hexo。下面做一个详细的介绍。</p>
<h4 id="本地端"><a href="#本地端" class="headerlink" title="本地端"></a>本地端</h4><h5 id="安装git-bash（git安装原文来自百度经验）"><a href="#安装git-bash（git安装原文来自百度经验）" class="headerlink" title="安装git bash（git安装原文来自百度经验）"></a>安装<code>git bash</code>（git安装原文来自百度经验）</h5><p>由于使用的是git命令。所以需要安装<code>git bash</code>，安装过程如下。</p>
<p>由于安装过程千篇一律，安装的详细过程请百度一下：</p>
<p><a href="https://jingyan.baidu.com/article/020278117cbe921bcc9ce51c.html" target="_blank" rel="noopener">图文详解Windows下安装最新版Git_百度经验</a></p>
<a id="more"></a>
<h5 id="安装node-js"><a href="#安装node-js" class="headerlink" title="安装node.js"></a>安装node.js</h5><h6 id="1、Windows-安装包-msi"><a href="#1、Windows-安装包-msi" class="headerlink" title="1、Windows 安装包(.msi)"></a>1、Windows 安装包(.msi)</h6><p>32 位安装包下载地址 : <a href="https://nodejs.org/dist/v4.4.3/node-v4.4.3-x86.msi" target="_blank" rel="noopener">https://nodejs.org/dist/v4.4.3/node-v4.4.3-x86.msi</a></p>
<p>64 位安装包下载地址 : <a href="https://nodejs.org/dist/v4.4.3/node-v4.4.3-x64.msi" target="_blank" rel="noopener">https://nodejs.org/dist/v4.4.3/node-v4.4.3-x64.msi</a></p>
<p>本文实例以 v0.10.26 版本为例，其他版本类似， 安装步骤：</p>
<p>步骤 1 : 双击下载后的安装包 <strong>v0.10.26</strong>，如下所示：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step1.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>步骤 2 : 点击以上的Run(运行)，将出现如下界面：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step2.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>步骤 3 : 勾选接受协议选项，点击 next（下一步） 按钮 :</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step3.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>步骤 4 : Node.js默认安装目录为 “C:\Program Files\nodejs\” , 你可以修改目录，并点击 next（下一步）：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step4.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>步骤 5 : 点击树形图标来选择你需要的安装模式 , 然后点击下一步 next（下一步）</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step5.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>步骤 6 :点击 Install（安装） 开始安装Node.js。你也可以点击 Back（返回）来修改先前的配置。 然后并点击 next（下一步）：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step6.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>安装过程：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step7.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>点击 Finish（完成）按钮退出安装向导。</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-msi-version-on-windows-step8.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>检测PATH环境变量是否配置了Node.js，点击开始$=》运行=》输入”cmd” =&gt; 输入命令”path”$，输出如下结果：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;</span><br><span class="line">C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;</span><br><span class="line">c:\python32\python;C:\MinGW\bin;C:\Program Files\GTK2-Runtime\lib;</span><br><span class="line">C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\nodejs\;</span><br><span class="line">C:\Users\rg\AppData\Roaming\npm</span><br></pre></td></tr></table></figure>
<p>我们可以看到环境变量中已经包含了C:\Program Files\nodejs\</p>
<p>检查Node.js版本</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/node-version-test.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<h6 id="2、Windows-二进制文件-exe-安装"><a href="#2、Windows-二进制文件-exe-安装" class="headerlink" title="2、Windows 二进制文件 (.exe)安装"></a>2、Windows 二进制文件 (.exe)安装</h6><p>32 位安装包下载地址 : <a href="http://nodejs.org/dist/v0.10.26/node.exe" target="_blank" rel="noopener">http://nodejs.org/dist/v0.10.26/node.exe</a></p>
<p>64 位安装包下载地址 : <a href="http://nodejs.org/dist/v0.10.26/x64/node.exe" target="_blank" rel="noopener">http://nodejs.org/dist/v0.10.26/x64/node.exe</a></p>
<p><strong>安装步骤</strong></p>
<p>步骤 1 : 双击下载的安装包 Node.exe ，将出现如下界面 :</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-exe-on-windows-step1.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>点击 Run（运行）按钮将出现命令行窗口：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/install-node-exe-on-windows-step21.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<h6 id="版本测试"><a href="#版本测试" class="headerlink" title="版本测试"></a>版本测试</h6><p>进入 node.exe 所在的目录，如下所示：</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://www.runoob.com/wp-content/uploads/2014/03/node-version.png" alt="node-version" title>
                </div>
                <div class="image-caption">node-version</div>
            </figure>
<p>如果你获得以上输出结果，说明你已经成功安装了Node.js。</p>
<h5 id="Hexo安装"><a href="#Hexo安装" class="headerlink" title="Hexo安装"></a>Hexo安装</h5><h6 id="利用命令行安装hexo"><a href="#利用命令行安装hexo" class="headerlink" title="利用命令行安装hexo"></a>利用命令行安装hexo</h6><p>Node.js安装完成后,在电脑任意位置,右键,选择 <strong>GitBash</strong> ,执行npm命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo</span><br></pre></td></tr></table></figure>
<h6 id="创建本地hexo文件夹-地址名字可自定义"><a href="#创建本地hexo文件夹-地址名字可自定义" class="headerlink" title="创建本地hexo文件夹(地址名字可自定义)"></a>创建本地hexo文件夹(地址名字可自定义)</h6><p>安装完成后,在本地选择一个目标文件夹(如:F:\Hexo),注意:在F:\Hexo文件夹内右键,选择<strong>GitBush</strong>,执行以下指令,<strong>Hexo</strong>就会自动在目标文件夹下创建建立网站所需要的文件,一分钟左右会执行完成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br></pre></td></tr></table></figure>
<p>效果如下:</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://7xs3op.com1.z0.glb.clouddn.com/hexo%E5%AE%8C%E6%88%90%E5%88%9D%E5%A7%8B%E5%8C%96.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure>
<p>安装依赖包,该命令执行后没有什么提示,完成后的本地文件夹列表为图示,可能会有所不同</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo install</span><br></pre></td></tr></table></figure>
<p>初始化完成后目录图:<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://7xs3op.com1.z0.glb.clouddn.com/hexo%E7%9B%AE%E5%BD%95.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure></p>
<p><strong>注意</strong>:因Hexo 3.0以后把服务器独立成了单独的模块,所以还需要安装hexo-server才可以使用,执行命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-server –save</span><br></pre></td></tr></table></figure>
<h6 id="本地校验查看"><a href="#本地校验查看" class="headerlink" title="本地校验查看"></a>本地校验查看</h6><p>到目前为止,我们已经搭建起本地的hexo博客了,执行以下命令(在F:\Hexo)中,然后根据提示到浏览器中进行访问,地址为 <code>localhost:4000</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo g 或者 hexo generate</span><br><span class="line">hexo server 或者 hexo s</span><br></pre></td></tr></table></figure>
<p>图示为:<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://7xs3op.com1.z0.glb.clouddn.com/4000.png" alt title>
                </div>
                <div class="image-caption"></div>
            </figure></p>
<p>如果访问成功,即代表了本地博客配置成功,但有以下几点需要注意：</p>
<ul>
<li><p>每次想访问本地博客,至少需要执行<code>hexo s</code>命令,这样才相当于服务启动,然后才可访问</p>
</li>
<li><p>有的电脑4000端口可能被占用,导致每次访问<code>localhost:4000</code>提示一直找不到网页,这时就需要修改端口号,执行命令 <code>hexo s -p 5000</code> 即代表使用<code>-p</code><strong>将端口号改为了5000,访问网址为</strong><code>localhost:5000</code></p>
<p><img src="http://7xs3op.com1.z0.glb.clouddn.com/5000.png" alt></p>
</li>
<li><p>成功图示 :</p>
<p><img src="http://7xs3op.com1.z0.glb.clouddn.com/%E8%AE%BF%E9%97%AE%E6%88%90%E5%8A%9F.png" alt></p>
</li>
</ul>
<ul>
<li>按下<strong>Ctrl+C</strong>即可停止服务</li>
</ul>
<h6 id="Hexo主题设置"><a href="#Hexo主题设置" class="headerlink" title="Hexo主题设置"></a>Hexo主题设置</h6><p>你可以在<a href="https://hexo.io/themes/" target="_blank" rel="noopener">官网</a> 或者 <a href="https://github.com/hexojs/hexo/wiki/Themes" target="_blank" rel="noopener">https://github.com/hexojs/hexo/wiki/Themes</a> 选择你需要的主题<br><strong>下载主题</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git clone &lt;repository&gt; themes/&lt;theme-name&gt;</span><br></pre></td></tr></table></figure>
<p><strong>启用主题</strong><br>修改your_blog_name目录下的_config.yml配置文件中的theme属性，将其设置为上面的 theme-name<br>修改设置后如果在浏览器中没有看到想要的效果，使用<code>$ hexo clean</code>来清除缓存，然后重新生成静态文件<code>$ hexo g</code><br><strong>修改主题</strong><br>修改主题是在 theme\your_theme 目录下进行相关操作的，本节内容主要讲的是修改 raytaylorism 主题。使用 raytaylorism 主题的注意事项在该主题的官方 github 地址中已经说明得很清楚了，只需要严格按着开发者要求做，就不会出现什么大问题。</p>
<ol>
<li>如果你想使用英文语言，建议将 languages 下的 default.yml 文件名修改为 en.yml，因为我在电脑上使用 default.yml 的时候，网页的语言会偶尔变成中文或者繁体，不知道什么原因。</li>
<li>如果你觉得正文在大屏幕下显得太窄（默认为700px定宽），可以修改 <code>source\css\_base\lib_customize.styl</code> 中的 <code>.container</code> 类的宽度设置，修改之后往往会出现右侧的目录栏与正文重叠的情况，继续修改 <code>source\css\_partial\tablecontents.styl</code> 里面的 <code>left calc(50% + 350px)</code> ，建议修为 <code>350px</code> 为你的正文宽度的一半，或者你自行调整直至满意。</li>
<li>在 <code>layout\_partial\plugin\reward.ejs</code> 文件中可以替换转账二维码和显示的“打赏文本”。</li>
<li>站点分析工具我使用的是百度分析平台，在 _config.yml 配置文件中添加</li>
</ol>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">baidu_analytics:</span><br></pre></td></tr></table></figure>
<p>然后将你的百度分析ID添加在后面。接着在</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">layout\_partial\plugin\analytics.ejs</span><br></pre></td></tr></table></figure>
<p>文件后面添加如下代码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&lt;% if (theme.baidu_analytics)&#123; %&gt;</span><br><span class="line">&lt;script&gt;</span><br><span class="line">var _hmt = _hmt || [];</span><br><span class="line">(function() &#123;</span><br><span class="line">var hm = document.createElement(&quot;script&quot;);</span><br><span class="line">hm.src = &quot;https://hm.baidu.com/hm.js?&lt;%= theme.baidu_analytics %&gt;&quot;;</span><br><span class="line">var s = document.getElementsByTagName(&quot;script&quot;)[0]; </span><br><span class="line">s.parentNode.insertBefore(hm, s);</span><br><span class="line">&#125;)();</span><br><span class="line">&lt;/script&gt;</span><br><span class="line">&lt;% &#125; %&gt;</span><br></pre></td></tr></table></figure>
<p>为 raytaylorism 主题添加统计站点访问量的功能：在</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">layout\_partial\after_footer.ejs</span><br></pre></td></tr></table></figure>
<p>文件中添加如下代码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;script async src=&quot;//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js&quot;&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure>
<p>然后将</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">layout\_partial\footer.ejs</span><br></pre></td></tr></table></figure>
<p>文件中最后一个</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;p&gt;</span><br></pre></td></tr></table></figure>
<p>元素替换成下面的代码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;p class=&quot;right&quot; style=&quot;margin-top: 0;&quot;&gt;</span><br><span class="line">&lt;span id=&quot;busuanzi_container_site_uv&quot; style=&quot;display: none;&quot;&gt;</span><br><span class="line">您好，您是本站点的第 &lt;span id=&quot;busuanzi_value_site_uv&quot; style=&quot;color: yellow;&quot;&gt;&lt;/span&gt; 位访客，祝您生活工作愉快</span><br><span class="line">&lt;/span&gt;&lt;/p&gt;</span><br></pre></td></tr></table></figure>
<p>如果想给每篇文章添加统计阅读量，我的做法是在 </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">layout\_partial\aticle.ejs</span><br></pre></td></tr></table></figure>
<p>文件中的</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;%- partial(&apos;post/time&apos;) %&gt;</span><br></pre></td></tr></table></figure>
<p>行后面添加如下代码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;div style=&quot;float: right;color: #E91E63&quot;&gt;</span><br><span class="line">&lt;span id=&quot;busuanzi_container_page_pv&quot; style=&quot;display: none;&quot;&gt;</span><br><span class="line">阅读次数 &lt;span id=&quot;busuanzi_value_page_pv&quot;&gt;&lt;/span&gt;</span><br><span class="line">&lt;/span&gt;&lt;/div&gt;</span><br></pre></td></tr></table></figure>
<p>提醒，不要把上面的代码添加到</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">layout\_partial\post\time.ejs</span><br></pre></td></tr></table></figure>
<h4 id="服务器端"><a href="#服务器端" class="headerlink" title="服务器端"></a>服务器端</h4><p>在服务器端，我们需要完成以下几件事情。</p>
<ol>
<li>为本地的 hexo_blog 配置一个部署静态文件的远程仓库。</li>
<li>配置 Nginx 托管博客文件目录。</li>
<li>配置远程仓库自动更新到博客文件目录的钩子。</li>
</ol>
<h5 id="创建私有-Git-仓库"><a href="#创建私有-Git-仓库" class="headerlink" title="创建私有 Git 仓库"></a>创建私有 Git 仓库</h5><p>在<code>/git/lvshen/</code>下，创建一个名为 <code>hexo_static</code>的裸仓库（bare repo）。 </p>
<p>然后修改目录的所有权和用户权限，之后 linux 用户都具备<code>/git/lvshen/</code> 目录下所有新生成的目录和文件的权限。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo mkdir /git/lvshen/</span><br><span class="line">sudo chown -R $USER:$USER /git/lvshen/</span><br><span class="line">sudo chmod -R 755 /git/lvshen/</span><br></pre></td></tr></table></figure>
<p>然后，执行如下命令：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd /git/lvshen/</span><br><span class="line">git init --bare hexo_static.git</span><br></pre></td></tr></table></figure>
<h5 id="创建-Git-钩子"><a href="#创建-Git-钩子" class="headerlink" title="创建 Git 钩子"></a>创建 Git 钩子</h5><p>接下来，在服务器上的裸仓库 hexo_static 创建一个钩子，在满足特定条件时将静态 HTML 文件传送到 Web 服务器的目录下，即 <code>/home/lvshen/hexo</code>。</p>
<p>在自动生成的 hooks 目录下创建一个新的钩子文件：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /home/git/wade/konwledge.git/hooks/post-receive</span><br></pre></td></tr></table></figure>
<p>在该文件中添加两行代码，指定 Git 的工作树（源代码）和 Git 目录（配置文件等）。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">!/bin/bash</span></span><br><span class="line"></span><br><span class="line">git --work-tree=/home/nginx/html/doc/bl/lvshen --git-dir=/git/lvshen/konwledge.git checkout -f</span><br></pre></td></tr></table></figure>
<p>保存并退出文件，并让该文件变为可执行文件。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chmod +x /home/git/wade/konwledge.git/hooks/post-receive</span><br></pre></td></tr></table></figure>
<h5 id="配置-Nginx-托管文件目录"><a href="#配置-Nginx-托管文件目录" class="headerlink" title="配置 Nginx 托管文件目录"></a>配置 Nginx 托管文件目录</h5><p>接下来，创建 <code>/home/nginx/html/doc/bl/lvshen</code> 目录，用于 Nginx 托管。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo mkdir -p /home/nginx/html/doc/bl/lvshen</span><br></pre></td></tr></table></figure>
<p>和上一步类似，这里也需要修改目录的所有权和权限。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo chown -R $USER:$USER /home/nginx/html/doc/bl/lvshen</span><br><span class="line">sudo chmod -R 755 /home/nginx/html/doc/bl/lvshen</span><br></pre></td></tr></table></figure>
<p>然后，修改 Nginx 的 <code>conf</code> 设置：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vim /home/nginx/conf/vhost/bl.wadecn.com.conf</span><br></pre></td></tr></table></figure>
<p>将其中的 root 指令指向<code>/home/nginx/html/doc/bl/lvshen</code> 目录。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">sserver &#123;</span><br><span class="line">        listen          9000;</span><br><span class="line">        server_name     bl.wadecn.com;</span><br><span class="line">        index           index.html index.htm index.php;</span><br><span class="line">        root            /home/nginx/html/doc/bl/lvshen;</span><br><span class="line">        #/home/nginx/html/doc</span><br><span class="line">        #log_format bl.wadecn.com '$remote_addr - $remote_user [$time_local] $request'</span><br><span class="line">        #'$status $body_bytes_sent $http_referer '</span><br><span class="line">        #'$http_user_agent $http_x_forwarded_for';</span><br><span class="line">        #access_log  log/bl.wadecn.com.log doc.wadecn.com;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>保存并退出文件。如果以后购买并备案域名之后，可以再将配置中的 default_server 修改为你的域名。</p>
<p>最后，重启 Nginx 服务，使得改动生效。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@bogon conf]# /home/nginx/sbin/nginx -s reload        #重启nginx</span><br></pre></td></tr></table></figure>
<h5 id="建立SSH信任关系"><a href="#建立SSH信任关系" class="headerlink" title="建立SSH信任关系"></a>建立SSH信任关系</h5><p>为了在本地能不需要密码的上传代码到服务器，需要在本地生成一个密匙并与服务器关联。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">在本地生成公钥和密钥：</span></span><br><span class="line">ssh-keygen -t rsa</span><br><span class="line"><span class="meta">#</span><span class="bash">将本机生成的公钥发送到服务器上（建立信任关系）：</span></span><br><span class="line">ssh-copy-id -i C:/Users/UserName/.ssh/id_rsa.pub root@server_ip       #UserName是电脑的用户名</span><br><span class="line"><span class="meta">#</span><span class="bash">测试ssh远程登录是否成功：</span></span><br><span class="line">ssh root@server_ip</span><br></pre></td></tr></table></figure>
<p>这样前后端的配置都完成了。我下载了一个主题：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git clone https://github.com/iTimeTraveler/hexo-theme-hiker.git themes/hiker</span><br></pre></td></tr></table></figure>
<p>部署博客地址：<a href="http://bl.wadecn.com/" target="_blank" rel="noopener">AsiaInfo</a></p>

        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2018-01-08T08:37:57.457Z" itemprop="dateUpdated">2018-01-08 16:37:57</time>
</span><br>


        
        原文链接：<a href="/2018/01/08/Hexo博客部署到Linux服务器上/" target="_blank" rel="external">https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/</a>
        
    </div>
    
    <footer>
        <a href="https://lvshen9.gitee.io">
            <img src="/img/avatar.jpg" alt="我的技术小房间">
            我的技术小房间
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hexo/">Hexo</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/博客/">博客</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/&title=《Hexo博客部署到Linux服务器上》 — Lvshen's Blog&pic=https://lvshen9.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/&title=《Hexo博客部署到Linux服务器上》 — Lvshen's Blog&source=服务器部署博客：AsiaInfo
以前Hexo博客是托管到github上，因为国内访问github速度有些慢，这次试着把博客部署到阿里云的服务器上。本地系..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《Hexo博客部署到Linux服务器上》 — Lvshen's Blog&url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/&via=https://lvshen9.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2018/01/25/从分布式协调到Zookeeper/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">从分布式协调到Zookeeper</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2017/11/19/监控平台配置文件说明/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">监控平台配置文件说明</h4>
      </a>
    </div>
  
</nav>



    











    <!-- Valine Comments -->
    <div class="comments vcomment" id="comments"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
    <!-- Valine Comments script -->
    <script>
        var GUEST_INFO = ['nick','mail','link'];
        var guest_info = 'nick,mail,link'.split(',').filter(function(item){
          return GUEST_INFO.indexOf(item) > -1
        });
        new Valine({
            el: '#comments',
            notify: 'false' == 'true',
            verify: 'false' == 'true',
            appId: "dy9kXHwg5jQUlLryQmpjWRlM-gzGzoHsz",
            appKey: "P9Nh39Ol0JbMMiYqNGHEP3ml",
            avatar: "mm",
            placeholder: "Just go go",
            guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
            pageSize: "10"
        })
    </script>
    <!-- Valine Comments end -->







</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="https://lvshen9.github.io/blog2/pay/weixin.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="https://lvshen9.github.io/blog2/pay/weixin.jpg" data-alipay="https://lvshen9.github.io/blog2/pay/zhifu.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>我的技术小房间 &copy; 2015 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/&title=《Hexo博客部署到Linux服务器上》 — Lvshen's Blog&pic=https://lvshen9.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/&title=《Hexo博客部署到Linux服务器上》 — Lvshen's Blog&source=服务器部署博客：AsiaInfo
以前Hexo博客是托管到github上，因为国内访问github速度有些慢，这次试着把博客部署到阿里云的服务器上。本地系..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《Hexo博客部署到Linux服务器上》 — Lvshen's Blog&url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/&via=https://lvshen9.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=https://lvshen9.gitee.io/2018/01/08/Hexo博客部署到Linux服务器上/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
